<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="Layout.xhtml">

<ui:define name="metadata">
<f:event listener="#{sessionBean.isLoggedIn}" type="preRenderView" />
</ui:define>

		<ui:define name="content">
			<h:form>
				<p:dataTable id="ticketTable" dynamic="true" var="ticket"
					value="#{tickets.tickets}">

					<f:facet name="header">  
             			Meine Tickets  
        			</f:facet>

					<p:column>
						<f:facet name="header">  
                    		Name  
            			</f:facet>
						<h:outputText value="#{ticket.name}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    		Datum  
            			</f:facet>
						<h:outputText value="#{ticket.date}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    	Ort  
            			</f:facet>
						<h:outputText value="#{ticket.location}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    		Preis  
            			</f:facet>
						<h:outputText value="#{ticket.pricePerTicket}" />
					</p:column>

					<p:column>
						<f:facet name="header">

						</f:facet>
						<p:commandButton id="printBtn" value="Drucken"
							action="access-denied.xhtml?faces-redirect=true"
							update="ticketTable" />
					</p:column>
				</p:dataTable>
			</h:form>
		</ui:define>
</ui:composition>